package com.wutao.panzh.admin.service.Impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.panzh.entity.RouteClassification;
import com.wutao.panzh.admin.mapper.RouteClassificationMapper;
import com.wutao.panzh.service.RouteClassificationService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class RouteClassificationServiceImpl implements RouteClassificationService {

    @Autowired
    private RouteClassificationMapper routeClassificationMapper;

    @Override
    public List<RouteClassification> getAllClassIfication() {
        return routeClassificationMapper.selectAll();
    }

    @Override
    public void insertRouteClassification(String classificationName) {
        RouteClassification routeClassification = new RouteClassification();
        routeClassification.setCategorizationInformation(classificationName);
        routeClassificationMapper.insert(routeClassification);
    }

    @Override
    public void deleteRouteClassification(String itemId) {
        RouteClassification routeClassification = new RouteClassification();
        routeClassification.setId(Integer.parseInt(itemId));
        routeClassificationMapper.delete(routeClassification);
    }
}
